/*
 * @Author: your name
 * @Date: 2022-02-28 09:34:36
 * @LastEditTime: 2022-02-28 09:43:28
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \JS\day02\2-构造函数创建数组.js
 */
var arr=new Array();
console.log(arr,arr.length,'构造函数');
//存放了参数
var  arr1=new Array(5);
console.log(arr1[1],arr1.length,'数组长度为5');
//存放小数报错
/* var  arr2=new Array(1.21);
console.log(arr1[1],arr1.length,'数组长度为5'); */
//
var arr4=new Array('terry')
console.log(arr4,arr[0],arr4.length,'数组元素为其他类型');

var arr5=new Array('terry','hello',12,[1,2,3,5])
console.log(arr5,arr5[3],arr5.length);